<%DIRECTIVE DYNAMIC;%>
<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-label="Close">
		<span aria-hidden="true">&times;</span>
	</button>
	<h5 class="modal-title" >投放卡券</h5>
</div>
<form id="eidtForm" role="form" class="form-horizontal parsley-form" data-parsley-validate 
                  action="${base}/platform/card/putonDo" method="post">
                  <div class="modal-body ">
	                <input type="hidden" name="id" value="${obj.card.id!}">
                	<div class="row mb10">
	                    <div class="col-lg-12">
	                    	<div class="form-group">
	                            <label for="spec_region" class="col-sm-2 control-label">使用片区</label>
								
	                            <div class="col-sm-8">
	                                <select id="spec_region" name="spec_region" class="form-control" >
	                                	<option value="">--不限定--</option>
	                                	<%for(region in obj.regionList){%>
	                                		 <option value="${region.id}">${region.name}</option>
	                                	<%}%>
	                                </select>
	                            </div>
	                        </div>
	                        <div class="form-group">
	                            <label for="spec_school" class="col-sm-2 control-label">使用驾校</label>
								
	                            <div class="col-sm-8">
	                                <select id="spec_school" name="spec_school" class="form-control" >
	                                	<option value="">--不限定--</option>
	                                	<%for(school in obj.schoolList){%>
	                                		 <option value="${school.id}">${school.name}</option>
	                                	<%}%>
	                                </select>
	                            </div>
	                        </div>
	                        <div class="form-group">
	                            <label for="spec_school" class="col-sm-2 control-label">产品类型</label>
								
	                            <div class="col-sm-8">
	                                <select id="spec_product_type" name="spec_product_type" class="form-control" >
	                                	<option value="">--不限定--</option>
	                                	<%for(proudct in obj.productList){%>
	                                		 <option value="${proudct.id}">${proudct.name}</option>
	                                	<%}%>
	                                </select>
	                            </div>
	                        </div>
	                        <div class="form-group">
                            	<label for="code" class="col-sm-2 control-label">使用规则</label>

	                            <div class="col-sm-8">
	                                <input type="text" id="specs" class="form-control" name="specs"  placeholder="使用规则">
	                            </div>
                        	</div>
	                    </div>
                    </div>
                </div>
                <div class="modal-footer">
		<button  class="btn btn-default btn-sm btn-parsley"  >投放</button> 
	</div>
            	</form>
<script>
$(document).ready(function () {
    $(document).ready(function () {
    	var dialog=$("#editModal");
		$("#editModalDialog").draggable();
        $('#eidtForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    Toast.success(data.msg);
                    datatable.ajax.reload();
	               	dialog.modal("hide");
                } else {
                    Toast.error(data.msg);
                    datatable.ajax.reload();
                 	dialog.modal("hide");
                }
            }
        });
    });
});
</script>
